package com.rich.live.controller;


import com.rich.live.pojo.TbLiveMessage;
import com.rich.live.service.LiveMessageService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hu
 * @version 1.0
 * @date 2021/08/14 18:51
 */
@RestController
@RequestMapping("/liveMessage")
public class LiveMessageController {

    private final LiveMessageService liveMessageService;

    public LiveMessageController(LiveMessageService liveMessageService) {
        this.liveMessageService = liveMessageService;
    }

    /**
     * 互动消息列表
     * @return List<TbLiveMessage>
     */
    @GetMapping("/liveMessageList")
    public List<TbLiveMessage> liveMessageList(){
        return liveMessageService.liveMessageList();
    }

    /**
     * 直播消息回复
     * @param liveMessage
     */
    @PostMapping("/addLiveMessage")
    public void addLiveMessage(TbLiveMessage liveMessage){
        liveMessageService.addLiveMessage(liveMessage);
    }

}
